from typing import List

from pydantic import BaseModel, Field


class PowerBaseModel(BaseModel):
    name: str = Field("测试菜单", description="名称")
    url: str = Field("/welcome", description="权限路径")


# 菜单列表
class PowerShowSchemas(PowerBaseModel):
    id: int = Field(0, description="序号")
    open_type: str = Field(0, description="打开方式")
    parent_id: int = Field(0, description="父类编号")
    order: int = Field(0, description="排序")
    enable: int = Field(0, description="状态")

    class Config:
        from_orm = True
        from_attributes = True


# 当前用户权限
class NowUserPowerList(PowerBaseModel):
    remark: str = Field("remark", description="板块说明")

    class Config:
        from_orm = True
        from_attributes = True


class AddPowerSchemas(PowerBaseModel):
    remark: str = Field("remark", description="板块说明")
    open_type: str = Field(0, description="打开方式")
    parent_id: int = Field(0, description="父类编号")